package chpt06;

import java.util.Iterator;
import java.util.Set;
import java.util.TreeSet;

public class TreeSetDemo03 {

	public static void main(String[] args) {
		Set<StudentV3> students = new TreeSet<>();
		students.add(new StudentV3("abx",18));
		students.add(new StudentV3("abc",20));
		students.add(new StudentV3("bax",17));
        Iterator<StudentV3> iter = students.iterator();
        while(iter.hasNext()) {
        	System.out.println(iter.next());
        }   
	}
}
